<!--
 * @Author: zlw
 * @Date: 2023-08-22 10:18:46
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-08-22 10:19:46
 * @Description: 左右版式2
-->
<template>
  <div class="right-layout">
    <div
      class="four-static"
      v-for="(item, index) in datas.imageList"
      :key="index"
      @click="goOhter(item)"
      :style="{ borderRadius: datas.borderRadius + 'px', marginBottom: datas.pageMargin + 'px', }">
      <div class="static-pic">
        <img :src="item.src" alt="" :style="{ borderRadius: datas.imageRadius + 'px' }" />
        <div class="jiaobiao" v-show="item.isVipShow === 1">
          <img v-show="item.vipObj.isVipShow" src="../../../assets/images/jbvip.png" alt="" />
        </div>
        <img class="jiaobiao1" v-show="item.vipObj.isProductShow" src="../../../assets/images/jbbuy.png" alt="" />
        <img class="jiaobiao1" v-show="item.vipObj.isExperienceShow" src="../../../assets/images/jbtiyan.png" alt="" />
        <span>{{ item.flag }}</span>
      </div>
      <div class="static-content">
        <div class="static-title">
          <p class="title-name" :style="{ fontWeight: datas.textWeight }">
            {{ item.text }}
          </p>
          <p class="title-desc">{{ item.desc }}</p>
        </div>
        <div class="static-paly-num">
          <span>￥{{ item.price || '0.00' }}</span>
          <img src="../../../assets/images/goumai.png" alt="" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { setProdSuitesByGoods } from '@/utils/common.js';
export default {
  name: '',
  props: {
    datas: Object
  },
  data () {
    return {
      resourceList: [],
      priceStr: ''
    };
  },
  mounted () {
    this.datas.imageList.map((item) => {
      setProdSuitesByGoods('book', '', item.id, '').then(data => {
        this.resourceList = JSON.parse(JSON.stringify(data));
        this.resourceList.map((ite) => {
          this.priceStr = ite.priceModes[0].price;
        });
        this.$set(item, 'price', this.priceStr);
      });
    });
  },
  methods: {
    goOhter (item) {
      const linkurl = `${window.location.origin}/mobparty/courseOrder?type=book&suiteId=${item.id}&goodsLabel=`;
      window.location.href = linkurl;
    }
  }
};
</script>

<style scoped lang="scss">
.right-layout {
  padding: 0 16px;
}
.four-static {
  display: flex;
  padding: 10px;
  background: #fff;
  .static-pic {
    position: relative;
    border-radius: 8px;
    img {
      width: 100px;
      height: 100px;
      // margin-right: 12px;
      display: block;
    }
    .jiaobiao{
      width: 24px;
      height: 18px;
      position: absolute;
      top: 0;
      right: 0;
      img{
        width:100%;
        height: 100%;
      }
    }
    .jiaobiao1{
      width: 30px;
      height: 18px;
      position: absolute;
      top: 0;
      right: 0;
    }
    span {
      color: #ffffff;
      display: block;
      font-size: 12px;
      position: absolute;
      bottom: 0;
      left: 0;
      width: 64px;
      height: 21px;
      line-height: 21px;
      text-align: center;
      background: linear-gradient(180deg, #ff6c6c 0%, #ff4f4f 100%);
      border-radius: 0px 8px 0px 8px;
    }
  }
}
.static-content {
  display: flex;
  padding: 4px 0;
  flex-direction: column;
  justify-content: space-between;
  margin-left: 16px;
  p {
    font-size: 16px;
    font-weight: bold;
    color: #333;
  }
  .title-name {
    overflow: hidden;
    line-height: normal;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
  }
  .title-desc {
    font-size: 14px;
    padding-top: 8px;
    font-weight: 400;
    color: #666;
    line-height: 21px;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .static-paly-num {
    display: flex;
    align-items: center;
    justify-content: space-between;
    img {
      width: 80px;
    }
    span {
      font-size: 12px;
      font-family: PingFang SC-Regular, PingFang SC, sans-serif;
      font-weight: 400;
      color: #666666;
    }
  }
}
</style>
